// https://leetcode.cn/problems/shortest-subarray-with-or-at-least-k-i/description/



func minimumSubarrayLength(nums []int, k int) int {
    ans := len(nums) + 1
	for i := 0; i < len(nums); i++ {
		t := 0
		for j := i; j < len(nums); j++ {
			t |= nums[j]
			if t >= k {
				ans = min(ans, j - i + 1)
			}
		}
	}
	if ans < len(nums) + 1 {
		return ans
	} else {
		return -1
	}
}